//
//  WWHeaderView.m
//  Shopping
//
//  Created by 张湾湾 on 16/8/19.
//  Copyright © 2016年 张湾湾. All rights reserved.
//

#import "WWHeaderView.h"
#import "WWHeaderViewModel.h"
@interface WWHeaderView()

@end
@implementation WWHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
//        [self loopView];

        
    }
    return self;
}
- (void)setImageArray:(NSArray<WWHeaderViewModel *> *)imageArray{
    _imageArray = imageArray;
    [self loopView];
//    self.headerView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0,SCREENW, 120) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]];
//    self.headerView.currentPageDotImage = [UIImage imageNamed:@"pageControlCurrentDot"];
//    self.headerView.pageDotImage = [UIImage imageNamed:@"pageControlDot"];
//    
//    NSMutableArray * mutArray = [NSMutableArray array];
//    for (WWHeaderViewModel * model in self.imageArray) {
//        
//        NSString * urlString = model.img;
//        [mutArray addObject:urlString];
//    }
//    NSLog(@"---- >>%@",mutArray);
//    self.headerView.imageURLStringsGroup = mutArray.copy;
//    
//    
//    [self addSubview:self.headerView];
//    
//
    
    }

    
- (void)loopView{
    self.headerView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0,SCREENW, 120) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]];
    self.headerView.currentPageDotImage = [UIImage imageNamed:@"pageControlCurrentDot"];
    self.headerView.pageDotImage = [UIImage imageNamed:@"pageControlDot"];
    
    NSMutableArray * mutArray = [NSMutableArray array];
    for (WWHeaderViewModel * model in self.imageArray) {
        
        NSString * urlString = model.img;
        [mutArray addObject:urlString];
    }
    self.headerView.imageURLStringsGroup = mutArray.copy;

    
    [self addSubview:self.headerView];

    
}


@end
